#ifndef ENTITY_H
#define ENTITY_H
#include "Troll3D_global.h"
#include <Mesh.h>
#include <Transform.h>
#include <Program.h>

#include <string>

/*! @brief The Entity class is the "main" class of Troll 3D. All object inside the scene will derive from Entity        */
class TROLL3DSHARED_EXPORT Entity
{
    public :

    /********************************/
    /*          Members             */
    /********************************/

        /********************************/
        /*          Properties          */
        /********************************/


            Transform		m_Transform;    /*!< The Transform object is used to determine the Entity position and rotation in Space	*/

            GLuint          m_GLSLProgram;  /*!< Id of a valide GLSL program compiled                                                   */
            std::string     m_Name;         /*!< Name of the Entity Object                                                              */
            Mesh * 			m_Mesh;         /*!< Mesh linked to the Entity object                                                       */
			
        /********************************/
        /*          Properties          */
        /********************************/

            virtual void Update();
            virtual void Display();

    /********************************/
    /*          Static              */
    /********************************/

        /********************************/
        /*          Properties          */
        /********************************/

            static std::vector<Entity *> Entities;

            static Entity & First();
            static Entity & Last();


        /********************************/
        /*          Method              */
        /********************************/

            static Entity * FindEntity(std::string name);
            static Entity * New();
            static Entity * New(Mesh * mesh);
            static void Remove(Entity * entity);
            static void Remove(int id);


    /********************************/
    /*          Constructors        */
    /********************************/

        Entity();


};

#endif
